#! /bin/bash

# Check for GUPPI_DIR
if test "${GUPPI_DIR}zz" = zz; then
    export GUPPI_DIR=/data1/demorest/guppi_daq
fi
echo "Using GUPPI_DIR=$GUPPI_DIR"

# Locations of stuff
opt64=/opt/64bit
python=$opt64/bin/python
guppi_dir=${GUPPI_DIR}
guppi_bin_dir=$guppi_dir/bin
guppi_python_dir=$guppi_dir/python

# Important vars
export PYTHONPATH=$opt64/lib/python:$opt64/lib/python/site-packages:$opt64/presto/lib/python
export LD_LIBRARY_PATH=$opt64/lib:$opt64/pgplot:$opt64/presto/lib

# Run to make sure status shmem exists
$guppi_bin_dir/check_guppi_status > /dev/null

# Fill params in
$python $guppi_python_dir/guppi_set_params.py

# Start data flow
$guppi_bin_dir/test_net_thread &
